const i18nService = {
  defaultLanguage: "ch",
  languages: [
    {
      lang: "en",
      name: "English",
      flag: process.env.BASE_URL + "media/svg/flags/226-united-states.svg"
    },
    {
      lang: "ch",
      name: "汉语",
      flag: process.env.BASE_URL + "media/svg/flags/034-china.svg"
    }
  ],
  /**
   * 将活动语言保留在本地存储中
   * @param lang
   */
  setActiveLanguage(lang) {
    localStorage.setItem("language", lang);
  },
  /**
   * 获取当前活动语言
   * @returns {string | string}
   */
  getActiveLanguage() {
    return localStorage.getItem("language") || this.defaultLanguage;
  }
};
export default i18nService;
